home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2004 April / Gamestar_61_2004-04_dvdb.iso / DVDStar / Editace / hltp.exe / {app} / Source Code / VirtualDub / sylia / ScriptInterpreter.h < prev    next >
C/C++ Source or Header  |  2003-10-01  |  973b  |  33 lines

  1. #ifndef f_SYLIA_SCRIPTINTERPRETER_H
  2. #define f_SYLIA_SCRIPTINTERPRETER_H
  3.  
  4. class CScriptValue;
  5. class CScriptError;
  6. struct CScriptObject;
  7. class IScriptInterpreter;
  8.  
  9. typedef CScriptValue (*ScriptRootHandlerPtr)(IScriptInterpreter *,char *,void *);
  10.  
  11. class IScriptInterpreter {
  12. public:
  13.     virtual    void Destroy()                                        =0;
  14.  
  15.     virtual void SetRootHandler(ScriptRootHandlerPtr, void *)    =0;
  16.  
  17.     virtual void ExecuteLine(char *s)                            =0;
  18.  
  19.     virtual void ScriptError(int e)                                =0;
  20.     virtual const char* TranslateScriptError(CScriptError& cse)    =0;
  21.     virtual char** AllocTempString(long l)                        =0;
  22.  
  23.     virtual CScriptValue LookupObjectMember(CScriptObject *obj, void *, char *szIdent) = 0;
  24. };
  25.  
  26. IScriptInterpreter *CreateScriptInterpreter();
  27.  
  28. #define GETPROC_CREATESCRIPTINTERPRETER(hInst)    ((IScriptInterpreter *(__stdcall *)())GetProcAddress(hInst, "_CreateScriptInterpreter@0"))
  29.  
  30. #define EXT_SCRIPT_ERROR(x)    (isi->ScriptError((CScriptError::x)))
  31.  
  32. #endif
  33.